<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="切换显示状态" @click=changeShow>
        <input type="button" value="累加年龄" @click=add>
      <img src="C:\Users\Administrator\Desktop\招聘\证件照.jpg" alt="正在加载..." v-show="isShow">
      <img src="C:\Users\Administrator\Desktop\招聘\证件照.jpg" alt="正在加载..." v-show="age>=18">
    </div>
    <script>
        // v-show根据表达值的真假切换元素的显示和隐藏
        // 原理是修改display，实现显示隐藏
        // 指令后面的内容会显示为布尔值
        // 值为true元素显示，值为flase元素隐藏
        //
       var vm = new Vue({
           el:"#app",
           data:{
             isShow:false,
             age:16
           },
           methods: {
            changeShow:function(){
              this.isShow = ! this.isShow;
            },
            add:function(){
            this.age++;
             }
           },
           
       });
    </script>
</body>
</html>